﻿<UserControl x:Class="Infrastructure.Controls.RtfEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <DockPanel LastChildFill="True">
        <ToolBarTray Name="toolBarPanel1" DockPanel.Dock="Top">
            <ToolBar Name="toolBar1" Height="30">
                <Button x:Name="SaveComment" 
                        Click="SaveCommentButton_Click" 
                        ToolBar.OverflowMode="Never" 
                        ToolTip="Save">
                    <Image Source="/Images/saveHS.png" Width="15" Height="15" />
                </Button>
                
                <Separator />
                
                <Button 
                    Command="ApplicationCommands.Cut" 
                    ToolTip="Cut">
                    <Image Source="/Images/cut.png" />
                </Button>
                <Button 
                    Command="ApplicationCommands.Copy"
                    ToolTip="Copy">
                    <Image Source="/Images/copy.png" />
                </Button>
                <Button 
                    Command="ApplicationCommands.Paste"
                    ToolTip="Paste">
                    <Image Source="/Images/paste.png" />
                </Button>
                
                <Separator />
                
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.ToggleBold" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    TextBlock.FontWeight="Bold"
                    ToolTip="Bold">
                    B
                </ToggleButton>
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.ToggleItalic" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    TextBlock.FontStyle="Italic"
                    ToolTip="Italic">
                    I
                </ToggleButton>
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.ToggleUnderline" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    ToolTip="Underline">
                    <TextBlock TextDecorations="Underline" >
                        U
                    </TextBlock>
                </ToggleButton>
                
                <Separator />
                
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.AlignLeft" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    ToolTip="Alignt left">
                    L
                </ToggleButton>
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.AlignCenter" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    ToolTip="Align centered">
                    C
                </ToggleButton>
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.AlignRight" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    ToolTip="Alignt right">
                    R
                </ToggleButton>
                <ToggleButton 
                    MinWidth="15"
                    Command="EditingCommands.AlignJustify" 
                    CommandTarget="{Binding ElementName=documentContent}"
                    ToolTip="Alignt justified">
                    J
                </ToggleButton>
            </ToolBar>
        </ToolBarTray>
        <RichTextBox Name="documentContent" />        
    </DockPanel>
</UserControl>
